@extends('admin.layouts.app')
@section('content')

                       
                        
                        <div class="row">
                        	<div class="col-lg-12">
                        		<div class="card-box">
                            <h2 class="m-t-0 header-title">Edit Admin</h2>
                            <hr/>
                             
                              @include('admin.common.error')
                        			<div class="row">
			                        	<div class="col-md-6">
                                  <form class="form-horizontal" role="form" action="{{url('zadmin/admins/'.$data->id)}}" method="post">{{ method_field('PUT') }}

                                              <div class="form-group">
                                                  <label class="col-md-2 control-label">Account</label>
                                                  <div class="col-md-10">
                                                      <input type="text" class="form-control" name="username" required="" value="{{$data->username}}" readonly="">
                                                  </div>
                                              </div>
                                              <div class="form-group">
                                                  <label class="col-md-2 control-label" for="example-email">Password</label>
                                                  <div class="col-md-10">
                                                      <input type="password"  name="password" class="form-control" value="" placeholder="" >
                                                  </div>
                                              </div>

                                              <div class="form-group">
                                                  <label class="col-md-2 control-label" for="example-email">Confirm password</label>
                                                  <div class="col-md-10">
                                                      <input type="password"  name="password2" class="form-control" value="" placeholder="" >
                                                  </div>
                                              </div>

                                              <div class="form-group">
                                                  <label class="col-md-2 control-label">Name</label>
                                                  <div class="col-md-10">
                                                      <input type="text" class="form-control" name="truename" required="" value="{{$data->truename}}" >
                                                  </div>
                                              </div>

                                              <div class="form-group">
                                                  <label class="col-md-2 control-label">Phone</label>
                                                  <div class="col-md-10">
                                                      <input type="text" class="form-control" name="phone" required="" value="{{$data->phone}}" >
                                                  </div>
                                              </div>
											  @if(session('admin')->role_id==1)
                                               <div class="form-group">
                                                  <label class="col-md-2 control-label">Role</label>
                                                  <div class="col-md-10">
                                                      <select  class="form-control" name="role_id" >
                                                        @foreach($roles as $role)
                                                        <option value="{{$role->id}}" {{$data->role_id==$role->id?'selected':''}}>{{$role->name}}</option>
                                                        @endforeach
                                                      </select>
                                                  </div>
                                              </div>
											  @endif
											
                                              

                                              

                                              <div class="form-group text-center">
                                                  
                                                  <button type="submit" class="btn btn-info waves-effect waves-light">Submit</button>
                                              </div>
                                              
                                              
                             {{csrf_field()}}
                                          </form>
                                </div>
			                        	
			                        </div>

                             
			                        
                        			
                        		</div>
                                
                            </div> <!-- end col -->

                            
                        </div>
@endsection
                        
                        
                        

                  
            
    @section('modal')        
     
    @endsection        
       

           



    
        @section('js')

        
        @endsection
    
